home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
3d_vb
/
3d4vb.bas
< prev
next >
Wrap
BASIC Source File
|
1995-09-06
|
21KB
|
637 lines
Sub BorderBox (Ctrl1 As Control, Ctrl2 As Control, H%)
OldDWVal = Ctrl2.DrawWidth
Ctrl2.DrawWidth = 1
Cleft% = Ctrl1.Left - 15
CTop% = Ctrl1.Top - 15
Cwide% = Ctrl1.Width + 20
Chigh% = Ctrl1.Height + 15
Ctrl2.Line (Cleft%, CTop%)-Step(Cwide%, 0), GRAY
Ctrl2.Line -Step(0, Chigh%), WHITE
Ctrl2.Line -Step(-Cwide%, 0), WHITE
Ctrl2.Line -Step(0, -Chigh%), GRAY
If H% = 2 Then
Cleft% = Ctrl1.Left - 30
CTop% = Ctrl1.Top - 30
Cwide% = Ctrl1.Width + 50
Chigh% = Ctrl1.Height + 40
Ctrl2.Line (Cleft%, CTop%)-Step(Cwide%, 0), GRAY
Ctrl2.Line -Step(0, Chigh%), WHITE
Ctrl2.Line -Step(-Cwide%, 0), WHITE
Ctrl2.Line -Step(0, -Chigh%), GRAY
End If
Ctrl2.DrawWidth = OldDWVal
End Sub ' BorderBox()
Sub BorderBoxOnFrm (Ctrl1 As Control, Ctrl2 As Form)
OldDWVal = Ctrl2.DrawWidth
Ctrl2.DrawWidth = 1
Cleft% = Ctrl1.Left - 15
CTop% = Ctrl1.Top - 15
Cwide% = Ctrl1.Width + 20
Chigh% = Ctrl1.Height + 20
Ctrl2.Line (Cleft%, CTop%)-Step(Cwide%, 0), GRAY
Ctrl2.Line -Step(0, Chigh%), WHITE
Ctrl2.Line -Step(-Cwide%, 0), WHITE
Ctrl2.Line -Step(0, -Chigh%), GRAY
Cleft% = Ctrl1.Left - 30
CTop% = Ctrl1.Top - 30
Cwide% = Ctrl1.Width + 45
Chigh% = Ctrl1.Height + 45
Ctrl2.Line (Cleft%, CTop%)-Step(Cwide%, 0), GRAY
Ctrl2.Line -Step(0, Chigh%), WHITE
Ctrl2.Line -Step(-Cwide%, 0), WHITE
Ctrl2.Line -Step(0, -Chigh%), GRAY
Ctrl2.DrawWidth = OldDWVal
End Sub ' BorderBoxOnFrm()
Sub EtchedFrame (Ctrl1 As Control, Text$, Just%, ColorVal, Dimen%)
OldDWVal = Ctrl1.DrawWidth
Ctrl1.DrawWidth = 1
' 0 = Left, 1 = Right, 2 = Center
TxLen% = Ctrl1.TextWidth(Text$)
Ctrl1.ForeColor = ColorVal
C1Left% = Ctrl1.ScaleLeft + 10
C1Top% = Ctrl1.ScaleTop + (Ctrl1.TextHeight("I") / 2)
C1Wide% = Ctrl1.ScaleWidth - 30
C1High% = (Ctrl1.ScaleHeight - 30)
C2Left% = Ctrl1.ScaleLeft
C2Top% = Ctrl1.ScaleTop + ((Ctrl1.TextHeight("I") / 2) - 10)
C2Wide% = Ctrl1.ScaleWidth - 15
C2High% = (Ctrl1.ScaleHeight - 10)
Select Case Just%
Case Is = 0 ' Left
L1Start% = C1Left%
L1End% = 120
R1Start% = L1End% + TxLen% + 240
R1End% = C1Wide%
L2Start% = C2Left%
L2End% = 110
R2Start% = L2End% + TxLen% + 240
R2End% = C2Wide%
Xpos% = 240
Ypos% = 0
Case Is = 1 ' Right
L1Start% = C1Left%
L1End% = (C1Wide% - TxLen%) - 350
R1Start% = C1Wide% - 120
R1End% = C1Wide%
L2Start% = C2Left%
L2End% = (C2Wide% - TxLen%) - 350
R2Start% = C2Wide% - 130
R2End% = C2Wide%
Xpos% = L1End% + 120
Ypos% = 0
Case Is = 2 ' Center
L1Start% = C1Left%
L1End% = (C1Wide% - (TxLen% + 240)) / 2
R1Start% = C1Wide% - L1End%
R1End% = C1Wide%
L2Start% = C2Left%
L2End% = (C2Wide% - (TxLen% + 240)) / 2
R2Start% = C2Wide% - L2End%
R2End% = C2Wide%
Xpos% = L1End% + 120
Ypos% = 0
End Select
If Dimen% = ETCHED Then
Ctrl1.Currentx = Xpos% + 15
Ctrl1.Currenty = Ypos% + 15
Ctrl1.ForeColor = WHITE
Ctrl1.Print Text$
End If
If Dimen% = RAISED Then
Ctrl1.Currentx = Xpos% - 15
Ctrl1.Currenty = Ypos% - 15
Ctrl1.ForeColor = WHITE
Ctrl1.Print Text$
Ctrl1.Currentx = Xpos% + 15
Ctrl1.Currenty = Ypos% + 15
Ctrl1.ForeColor = GRAY
Ctrl1.Print Text$
End If
Ctrl1.Currentx = Xpos%
Ctrl1.Currenty = Ypos%
Ctrl1.ForeColor = ColorVal
Ctrl1.Print Text$
Ctrl1.Line (L1Start%, C1Top%)-(L1End%, C1Top%), WHITE
Ctrl1.Line (R1Start%, C1Top%)-(R1End%, C1Top%), WHITE
Ctrl1.Line (R1End%, C1Top%)-(R1End%, C1High%), GRAY
Ctrl1.Line (R1End%, C1High%)-(L1Start%, C1High%), GRAY
Ctrl1.Line (L1Start%, C1High%)-(L1Start%, C1Top%), WHITE
Ctrl1.Line (L2Start%, C2Top%)-(L2End%, C2Top%), GRAY
Ctrl1.Line (R2Start%, C2Top%)-(R2End%, C2Top%), GRAY
Ctrl1.Line (R2End%, C2Top%)-(R2End%, C2High%), WHITE
Ctrl1.Line (R2End%, C2High%)-(L2Start%, C2High%), WHITE
Ctrl1.Line (L2Start%, C2High%)-(L2Start%, C2Top%), GRAY
Ctrl1.DrawWidth = OldDWVal
End Sub ' EtchedFrame()
Sub EtchedFrmLine (Ctrl1 As Form, X1pos%, Y1pos%, X2pos%, Y2pos%)
OldDWVal = Ctrl1.DrawWidth
Ctrl1.AutoRedraw = True
Ctrl1.DrawWidth = 1
Ctrl1.Line (X1pos%, Y1pos%)-(X2pos%, Y2pos%), GRAY
Ctrl1.Line (X1pos% + 15, Y1pos% + 15)-(X2pos% + 15, Y2pos% + 15), WHITE
Ctrl1.DrawWidth = OldDWVal
End Sub ' EtchedFrmLine()
Sub EtchedFrmText (Ctrl1 As Form, Text$, Xpos%, Ypos%, ColorVal)
OldDWVal = Ctrl1.DrawWidth
Ctrl1.DrawWidth = 1
StartColor = Ctrl1.ForeColor
Ctrl1.Currentx = Xpos% + 15
Ctrl1.Currenty = Ypos% + 15
Ctrl1.ForeColor = WHITE
Ctrl1.Print Text$
Ctrl1.Currentx = Xpos%
Ctrl1.Currenty = Ypos%
Ctrl1.ForeColor = ColorVal
Ctrl1.Print Text$
Ctrl1.ForeColor = StartColor
Ctrl1.DrawWidth = OldDWVal
End Sub ' EtchedFrmText()
Sub EtchedPicBorder (Ctrl1 As Control)
OldDWVal = Ctrl1.DrawWidth
Ctrl1.DrawWidth = 1
Cleft% = Ctrl1.ScaleLeft + 10
CTop% = Ctrl1.ScaleTop + 10
Cwide% = Ctrl1.ScaleWidth - 30
Chigh% = Ctrl1.ScaleHeight - 30
Ctrl1.Line (Cleft%, CTop%)-Step(Cwide%, 0), WHITE
Ctrl1.Line -Step(0, Chigh%), GRAY
Ctrl1.Line -Step(-Cwide%, 0), GRAY
Ctrl1.Line -Step(0, -Chigh%), WHITE
Cleft% = Ctrl1.ScaleLeft
CTop% = Ctrl1.ScaleTop
Cwide% = Ctrl1.ScaleWidth - 15
Chigh% = Ctrl1.ScaleHeight - 15
Ctrl1.Line (Cleft%, CTop%)-Step(Cwide%, 0), GRAY
Ctrl1.Line -Step(0, Chigh%), WHITE
Ctrl1.Line -Step(-Cwide%, 0), WHITE
Ctrl1.Line -Step(0, -Chigh%), GRAY
Ctrl1.DrawWidth = OldDWVal
End Sub ' EtchedPicBorder()
Sub EtchedPicText (Ctrl1 As Control, Text$, Xpos%, Ypos%, ColorVal)
OldDWVal = Ctrl1.DrawWidth
Ctrl1.DrawWidth = 1
StartColor = Ctrl1.ForeColor
Ctrl1.Currentx = Xpos% + 15
Ctrl1.Currenty = Ypos% + 15
Ctrl1.ForeColor = WHITE
Ctrl1.Print Text$
Ctrl1.Currentx = Xpos%
Ctrl1.Currenty = Ypos%
Ctrl1.ForeColor = ColorVal
Ctrl1.Print Text$
Ctrl1.ForeColor = StartColor
Ctrl1.DrawWidth = OldDWVal
End Sub ' EtchedPicText()
Sub FormBorder (Ctrl1 As Form)
OldDWVal = Ctrl1.DrawWidth
Ctrl1.DrawWidth = 1
Cleft% = Ctrl1.ScaleLeft
CTop% = Ctrl1.ScaleTop
Cwide% = Ctrl1.ScaleWidth - 15
Chigh% = Ctrl1.ScaleHeight - 15
Ctrl1.Line (Cleft%, CTop%)-Step(Cwide%, 0), WHITE
Ctrl1.Line -Step(0, Chigh%), GRAY
Ctrl1.Line -Step(-Cwide%, 0), GRAY
Ctrl1.Line -Step(0, -Chigh%), WHITE
Cleft% = Ctrl1.ScaleLeft + 15
CTop% = Ctrl1.ScaleTop + 15
Cwide% = Ctrl1.ScaleWidth - 45
Chigh% = Ctrl1.ScaleHeight - 45
Ctrl1.Line (Cleft%, CTop%)-Step(Cwide%, 0), WHITE
Ctrl1.Line -Step(0, Chigh%), GRAY
Ctrl1.Line -Step(-Cwide%, 0), GRAY
Ctrl1.Line -Step(0, -Chigh%), WHITE
Ctrl1.DrawWidth = OldDWVal
End Sub ' FormBorder()
Sub FormFrame (Ctrl1 As Form)
OldDWVal = Ctrl1.DrawWidth
Ctrl1.DrawWidth = 1
Cleft% = Ctrl1.ScaleLeft + 60
CTop% = Ctrl1.ScaleTop + 60
Cwide% = Ctrl1.ScaleWidth - 130
Chigh% = Ctrl1.ScaleHeight - 130
Ctrl1.Line (Cleft%, CTop%)-Step(Cwide%, 0), GRAY
Ctrl1.Line -Step(0, Chigh%), WHITE
Ctrl1.Line -Step(-Cwide%, 0), WHITE
Ctrl1.Line -Step(0, -Chigh%), GRAY
Cleft% = Ctrl1.ScaleLeft
CTop% = Ctrl1.ScaleTop
Cwide% = Ctrl1.ScaleWidth - 10
Chigh% = Ctrl1.ScaleHeight - 10
Ctrl1.Line (Cleft%, CTop%)-Step(Cwide%, 0), WHITE
Ctrl1.Line -Step(0, Chigh%), GRAY
Ctrl1.Line -Step(-Cwide%, 0), GRAY
Ctrl1.Line -Step(0, -Chigh%), WHITE
Ctrl1.DrawWidth = OldDWVal
End Sub ' FormFrame()
Sub HighlightEntry